{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Imputation of missing values with IsoTree\n",
    "\n",
    "This is a short example about imputation of missing values with the package [isotree](https://www.github.com/david-cortes/isotree) (Isolation Forest and variations), which produces imputations by taking the values from observations in the terminal nodes of each tree in which an observation with missing values falls at prediction time, combining the non-missing values of the other observations as a weighted average according to the depth of the node and the number of observations that fall there. This is not related to how the model handles missing values internally, but is rather meant as a faster way of imputing by similarity. Quality is not as good as chained equations, but the method is a lot faster and more scalable. Recommended to use non-random splits when used as an imputer.\n",
    "\n",
    "\n",
    "The example here is copy-pasted from SciKit-Learn's usage guide for their imputer, and just adds a few extra lines that do the job with this package.\n",
    "\n",
    "Original code was taken from this link:\n",
    "\n",
    "[https://scikit-learn.org/stable/auto_examples/impute/plot_iterative_imputer_variants_comparison.html#sphx-glr-auto-examples-impute-plot-iterative-imputer-variants-comparison-py](https://scikit-learn.org/stable/auto_examples/impute/plot_iterative_imputer_variants_comparison.html#sphx-glr-auto-examples-impute-plot-iterative-imputer-variants-comparison-py)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA6IAAAGqCAYAAAARNPnDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nOzdebxVVfnH8c9XEBwQMDEjUm8qTjnghLNRGg5YmlrOY2ZpaulPi8pKS5PSnDJ/iWaoOVUOOYv+EnFCQURAcxYtJxyQQFEZnt8fax3Z93jOuffCZV+E7/v14uU9e1jr2Wvvcz3PedbeVxGBmZmZmZmZWVmW6OgAzMzMzMzMbPHiRNTMzMzMzMxK5UTUzMzMzMzMSuVE1MzMzMzMzErlRNTMzMzMzMxK5UTUzMzMzMz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0c2yfhnYDvhEkpFfkL9tCiV+ETgpyRK6sLfapbVVdUmS5wBfb7nuQeA4YMUkx5tsrcuArwJPB06qqoeTnEX37OgNLVT+EDgKWAI8luQbwELgk8CC9h1+AHgv8EFgSTtvOXD4OOMeSPfdStK0lqrRK0ckSZLWr/ZiocuAfatqsiFQE0hyOXBkVd0/7FokaXUMopIkaSiS/BbwraqaypJejSPJtnTB/rPDrkWSJmIQlSRJkiT1ypcVSZIkSZJ6ZRCVJEmSJPXKICpJkiRJ6pVBVJIkSZLUK4OoJEmSJKlX/x8w/kItx3sGngAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 936x432 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import pandas as pd\n",
    "%matplotlib inline\n",
    "\n",
    "### As of 2019-11-02, SciKit-Learn's example throws lots of convergence warnings\n",
    "import warnings\n",
    "warnings.filterwarnings(\"ignore\")\n",
    "\n",
    "# To use this experimental feature, we need to explicitly ask for it:\n",
    "from sklearn.experimental import enable_iterative_imputer  # noqa\n",
    "from sklearn.datasets import fetch_california_housing\n",
    "from sklearn.impute import SimpleImputer\n",
    "from sklearn.impute import IterativeImputer\n",
    "from sklearn.linear_model import BayesianRidge\n",
    "from sklearn.tree import DecisionTreeRegressor\n",
    "from sklearn.ensemble import ExtraTreesRegressor\n",
    "from sklearn.neighbors import KNeighborsRegressor\n",
    "from sklearn.pipeline import make_pipeline\n",
    "from sklearn.model_selection import cross_val_score\n",
    "\n",
    "N_SPLITS = 5\n",
    "\n",
    "rng = np.random.RandomState(0)\n",
    "\n",
    "X_full, y_full = fetch_california_housing(return_X_y=True)\n",
    "# ~2k samples is enough for the purpose of the example.\n",
    "# Remove the following two lines for a slower run with different error bars.\n",
    "X_full = X_full[::10]\n",
    "y_full = y_full[::10]\n",
    "n_samples, n_features = X_full.shape\n",
    "\n",
    "# Estimate the score on the entire dataset, with no missing values\n",
    "br_estimator = BayesianRidge()\n",
    "score_full_data = pd.DataFrame(\n",
    "    cross_val_score(\n",
    "        br_estimator, X_full, y_full, scoring='neg_mean_squared_error',\n",
    "        cv=N_SPLITS\n",
    "    ),\n",
    "    columns=['Full Data']\n",
    ")\n",
    "\n",
    "# Add a single missing value to each row\n",
    "X_missing = X_full.copy()\n",
    "y_missing = y_full\n",
    "missing_samples = np.arange(n_samples)\n",
    "missing_features = rng.choice(n_features, n_samples, replace=True)\n",
    "X_missing[missing_samples, missing_features] = np.nan\n",
    "\n",
    "# Estimate the score after imputation (mean and median strategies)\n",
    "score_simple_imputer = pd.DataFrame()\n",
    "for strategy in ('mean', 'median'):\n",
    "    estimator = make_pipeline(\n",
    "        SimpleImputer(missing_values=np.nan, strategy=strategy),\n",
    "        br_estimator\n",
    "    )\n",
    "    score_simple_imputer[strategy] = cross_val_score(\n",
    "        estimator, X_missing, y_missing, scoring='neg_mean_squared_error',\n",
    "        cv=N_SPLITS\n",
    "    )\n",
    "    \n",
    "##### NEW ADDITION HERE #########\n",
    "# This is the piece of code that adds imputations with isotree\n",
    "from isotree import IsolationForest\n",
    "estimator = make_pipeline(\n",
    "        IsolationForest(build_imputer=True, min_imp_obs=1, prob_pick_pooled_gain=1, ntry=15),\n",
    "        br_estimator\n",
    "    )\n",
    "score_simple_imputer[\"isotree\"] = cross_val_score(\n",
    "        estimator, X_missing, y_missing, scoring='neg_mean_squared_error',\n",
    "        cv=N_SPLITS\n",
    "    )\n",
    "##### END OF NEW ADDITION #########\n",
    "\n",
    "# Estimate the score after iterative imputation of the missing values\n",
    "# with different estimators\n",
    "estimators = [\n",
    "    BayesianRidge(),\n",
    "    DecisionTreeRegressor(max_features='sqrt', random_state=0),\n",
    "    ExtraTreesRegressor(n_estimators=10, random_state=0),\n",
    "    KNeighborsRegressor(n_neighbors=15)\n",
    "]\n",
    "score_iterative_imputer = pd.DataFrame()\n",
    "for impute_estimator in estimators:\n",
    "    estimator = make_pipeline(\n",
    "        IterativeImputer(random_state=0, estimator=impute_estimator),\n",
    "        br_estimator\n",
    "    )\n",
    "    score_iterative_imputer[impute_estimator.__class__.__name__] = \\\n",
    "        cross_val_score(\n",
    "            estimator, X_missing, y_missing, scoring='neg_mean_squared_error',\n",
    "            cv=N_SPLITS\n",
    "        )\n",
    "\n",
    "scores = pd.concat(\n",
    "    [score_full_data, score_simple_imputer, score_iterative_imputer],\n",
    "    keys=['Original', 'SimpleImputer', 'IterativeImputer'], axis=1\n",
    ")\n",
    "\n",
    "# plot boston results\n",
    "fig, ax = plt.subplots(figsize=(13, 6))\n",
    "means = -scores.mean()\n",
    "errors = scores.std()\n",
    "means.plot.barh(xerr=errors, ax=ax)\n",
    "ax.set_title('California Housing Regression with Different Imputation Methods')\n",
    "ax.set_xlabel('MSE (smaller is better)')\n",
    "ax.set_yticks(np.arange(means.shape[0]))\n",
    "ax.set_yticklabels([\" w/ \".join(label) for label in means.index.get_values()])\n",
    "plt.tight_layout(pad=1)\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python (OpenBLAS)",
   "language": "python",
   "name": "py3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
